<script setup>
import { useRouter } from 'vue-router'

// 定义页面元数据
defineOptions({
  name: '404'
})

const router = useRouter()

// 返回首页
const goHome = () => {
  router.replace('/home')
}
</script>

<template>
  <div class="not-found">
    <van-empty image="error" description="页面不存在">
      <van-button round type="primary" @click="goHome">返回首页</van-button>
    </van-empty>
  </div>
</template>
<route>
  {
    path: '/404',
    name: '404',
    meta: { 
      title: '页面不存在',
      hideTabbar: true, 
      showNavBar: false 
    }
  }
</route>
